﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace BusinessClass
{
    public class BuildInfo
    {
        public string XL { get; set; }
        public string XN { get; set; }
        public string Time { get; set; }
        public string Addr { get; set; }
        public string MapLink { get; set; }
        public BuildInfo(string filePath)
        {
            var lines = File.ReadAllLines(filePath);
            foreach (string line in lines)
            {
                if (line.StartsWith("新郎"))
                {
                    XL = line.Substring(3);
                }
                else if (line.StartsWith("新娘"))
                {
                    XN = line.Substring(3);
                }
                else if (line.StartsWith("时间"))
                {
                    Time = line.Substring(3);
                }
                else if (line.StartsWith("地点"))
                {
                    Addr = line.Substring(3);
                }
                else if (line.StartsWith("地图链接"))
                {
                    MapLink = line.Substring(5);
                }
            }
        }
    }
}
